<?php
!defined('P_W') && exit('Forbidden');

define('AREA_SCR','upload');
$imageService = House::loadClass('houseimage'); /* @var $imageService PW_HouseImage */
InitGP('uid');
//$uid = intval($uid);
if ($_POST['step']) unset($_GET['verify']);
$swfhash = GetVerify($uid);
checkVerify('swfhash');

if (empty($_POST['step'])) {
	$xmlString = $imageService->getFlash($uid);
	echo "$xmlString";
	exit;
} elseif ($_POST['step']==2) {
	InitGP(array('hid','aid','desc'));

	$rt = $db->get_one("SELECT groupid,memberid,username FROM pw_members WHERE uid=" . pwEscape($uid));
	(!$rt) && Showmsg('not_login');

	$imageService->addImages($hid,$aid,$rt['username'],$desc);
	exit;
}
?>